﻿using System;
using System.Collections.Generic;
using System.Linq;
using log4net;

namespace RIBA.Web.Model
{
	public class UserEntitiesMock
	{
		private static readonly ILog _log = LogManager.GetLogger(typeof(UserEntitiesMock));

		public IList<UserDTO> Users { get; set; }

		public UserEntitiesMock()
		{
			try
			{
				_log.DebugFormat("UserEntitiesMock");

				Users = new List<UserDTO>();

				var roles = new List<string>();
				roles.Add("admin");

				Users.Add(new UserDTO { Name = "test", Password = "pass", Roles = roles.AsEnumerable() });

				roles = new List<string>();
				roles.Add("browse");
				Users.Add(new UserDTO { Name = "test1", Password = "pass", Roles = roles.AsEnumerable() });
			}
			catch (Exception ex)
			{
				_log.Fatal(string.Format("Error in UserEntitiesMock"), ex);
			}
		}
	}
}